brightness_glsl_declarations,
brightness_glsl);
cogl_pipeline_add_snippet (brightness_pipeline, snippet);
- cogl_object_unref (snippet);
+ g_object_unref (snippet);
}
return cogl_pipeline_copy (brightness_pipeline);
CoglContext *ctx =
clutter_backend_get_cogl_context (clutter_get_default_backend ());
- g_clear_pointer (&data->texture, cogl_object_unref);
+ g_clear_object (&data->texture);
g_clear_object (&data->framebuffer);
float new_width = floorf (width / downscale_factor);
static void
clear_framebuffer_data (FramebufferData *fb_data)
{
- g_clear_pointer (&fb_data->texture, cogl_object_unref);
+ g_clear_object (&fb_data->texture);
g_clear_object (&fb_data->framebuffer);
}
clear_framebuffer_data (&self->background_fb);
clear_framebuffer_data (&self->brightness_fb);
- g_clear_pointer (&self->actor_fb.pipeline, cogl_object_unref);
- g_clear_pointer (&self->background_fb.pipeline, cogl_object_unref);
- g_clear_pointer (&self->brightness_fb.pipeline, cogl_object_unref);
+ g_clear_object (&self->actor_fb.pipeline);
+ g_clear_object (&self->background_fb.pipeline);
+ g_clear_object (&self->brightness_fb.pipeline);
G_OBJECT_CLASS (shell_blur_effect_parent_class)->finalize (object);
}
cogl_pipeline_set_layer_texture (priv->pipeline, 0, texture);
- return cogl_object_ref (priv->pipeline);
+ return g_object_ref (priv->pipeline);
}
/**
else
cogl_pipeline_add_layer_snippet (klass->base_pipeline, 0, snippet);
- cogl_object_unref (snippet);
+ g_object_unref (snippet);
}
static void
priv = shell_glsl_effect_get_instance_private (self);
- g_clear_pointer (&priv->pipeline, cogl_object_unref);
+ g_clear_object (&priv->pipeline);
G_OBJECT_CLASS (shell_glsl_effect_parent_class)->dispose (gobject);
}
cogl_pipeline_set_layer_texture (self->pipeline, 0, texture);
- return cogl_object_ref (self->pipeline);
+ return g_object_ref (self->pipeline);
}
static void
{
ShellInvertLightnessEffect *self = SHELL_INVERT_LIGHTNESS_EFFECT (gobject);
- if (self->pipeline != NULL)
- {
- cogl_object_unref (self->pipeline);
- self->pipeline = NULL;
- }
+ g_clear_object (&self->pipeline);
G_OBJECT_CLASS (shell_invert_lightness_effect_parent_class)->dispose (gobject);
}
NULL);
cogl_snippet_set_replace (snippet, invert_lightness_source);
cogl_pipeline_add_layer_snippet (klass->base_pipeline, 0, snippet);
- cogl_object_unref (snippet);
+ g_object_unref (snippet);
cogl_pipeline_set_layer_null_texture (klass->base_pipeline, 0);
}
unsigned int width, height;
CoglContext *ctx;
CoglPipeline *pipeline;
- CoglTexture2D *texture;
+ CoglTexture *texture;
CoglOffscreen *offscreen;
ClutterStageView *view;
pipeline,
-1, 1, 1, -1,
0, 0, 1, 1);
- cogl_object_unref (pipeline);
+ g_object_unref (pipeline);
g_object_unref (offscreen);
priv->cursor_content =
clutter_texture_content_new_from_texture (texture, NULL);
- cogl_object_unref (texture);
+ g_object_unref (texture);
priv->cursor_scale = meta_cursor_tracker_get_scale (tracker);
cairo_image_surface_get_data (surface));
cairo_surface_mark_dirty (surface);
- cogl_object_unref (sub_texture);
+ g_object_unref (sub_texture);
cairo_surface_set_device_scale (surface, scale, scale);
StEntry *entry = ST_ENTRY (object);
StEntryPrivate *priv = ST_ENTRY_PRIV (entry);
- cogl_clear_object (&priv->text_shadow_material);
+ g_clear_object (&priv->text_shadow_material);
G_OBJECT_CLASS (st_entry_parent_class)->dispose (object);
}
if (!priv->shadow_spec || !shadow_spec ||
!st_shadow_equal (shadow_spec, priv->shadow_spec))
{
- g_clear_pointer (&priv->text_shadow_material, cogl_object_unref);
+ g_clear_object (&priv->text_shadow_material);
g_clear_pointer (&priv->shadow_spec, st_shadow_unref);
if (shadow_spec)
st_entry_update_hint_visibility (entry);
- g_clear_pointer (&priv->text_shadow_material, cogl_object_unref);
+ g_clear_object (&priv->text_shadow_material);
}
static void
st_entry_update_hint_visibility (entry);
/* Since the text changed, force a regen of the shadow texture */
- cogl_clear_object (&priv->text_shadow_material);
+ g_clear_object (&priv->text_shadow_material);
g_object_notify_by_pspec (G_OBJECT (entry), props[PROP_TEXT]);
}
{
StEntryPrivate *priv = ST_ENTRY_PRIV (entry);
- g_clear_pointer (&priv->text_shadow_material, cogl_object_unref);
+ g_clear_object (&priv->text_shadow_material);
}
static void
{
CoglPipeline *material;
- cogl_clear_object (&priv->text_shadow_material);
+ g_clear_object (&priv->text_shadow_material);
material = _st_create_shadow_pipeline_from_actor (priv->shadow_spec,
priv->entry);
g_clear_object (&priv->gicon);
g_clear_object (&priv->fallback_gicon);
g_clear_pointer (&priv->colors, st_icon_colors_unref);
- g_clear_pointer (&priv->shadow_pipeline, cogl_object_unref);
+ g_clear_object (&priv->shadow_pipeline);
g_clear_pointer (&priv->shadow_spec, st_shadow_unref);
G_OBJECT_CLASS (st_icon_parent_class)->dispose (gobject);
{
StIconPrivate *priv = icon->priv;
- g_clear_pointer (&priv->shadow_pipeline, cogl_object_unref);
+ g_clear_object (&priv->shadow_pipeline);
graphene_size_init (&priv->shadow_size, 0, 0);
}
if (!priv->shadow_spec || !shadow_spec ||
!st_shadow_equal (shadow_spec, priv->shadow_spec))
{
- g_clear_pointer (&priv->text_shadow_pipeline, cogl_object_unref);
+ g_clear_object (&priv->text_shadow_pipeline);
g_clear_pointer (&priv->shadow_spec, st_shadow_unref);
if (shadow_spec)
StLabelPrivate *priv = ST_LABEL (object)->priv;
priv->label = NULL;
- g_clear_pointer (&priv->text_shadow_pipeline, cogl_object_unref);
+ g_clear_object (&priv->text_shadow_pipeline);
G_OBJECT_CLASS (st_label_parent_class)->dispose (object);
}
width != priv->shadow_width ||
height != priv->shadow_height)
{
- g_clear_pointer (&priv->text_shadow_pipeline, cogl_object_unref);
+ g_clear_object (&priv->text_shadow_pipeline);
priv->shadow_width = width;
priv->shadow_height = height;
{
StLabelPrivate *priv = ST_LABEL (actor)->priv;
- g_clear_pointer (&priv->text_shadow_pipeline, cogl_object_unref);
+ g_clear_object (&priv->text_shadow_pipeline);
if (CLUTTER_ACTOR_CLASS (st_label_parent_class)->resource_scale_changed)
CLUTTER_ACTOR_CLASS (st_label_parent_class)->resource_scale_changed (actor);
{
StLabelPrivate *priv = st_label_get_instance_private (label);
- g_clear_pointer (&priv->text_shadow_pipeline, cogl_object_unref);
+ g_clear_object (&priv->text_shadow_pipeline);
}
static void
if (clutter_text_get_editable (ctext) ||
g_strcmp0 (clutter_text_get_text (ctext), text) != 0)
{
- g_clear_pointer (&priv->text_shadow_pipeline, cogl_object_unref);
+ g_clear_object (&priv->text_shadow_pipeline);
clutter_text_set_text (ctext, text);
fb = COGL_FRAMEBUFFER (offscreen);
if (!cogl_framebuffer_allocate (fb, &error))
{
- cogl_clear_object (&texture);
+ g_clear_object (&texture);
return NULL;
}
texture_pipeline = cogl_pipeline_new (ctx);
cogl_pipeline_add_snippet (texture_pipeline, snippet);
- cogl_object_unref (snippet);
+ g_object_unref (snippet);
cogl_context_set_named_pipeline (ctx,
&texture_pipeline_key,
pipeline = cogl_pipeline_copy (shadow_pipeline_template);
cogl_pipeline_set_layer_texture (pipeline, 0, texture);
- cogl_clear_object (&texture);
+ g_clear_object (&texture);
return pipeline;
}
if (shadow_pipeline == NULL)
{
- CoglTexture *buffer;
+ g_autoptr(CoglTexture) buffer = NULL;
CoglOffscreen *offscreen;
CoglFramebuffer *fb;
CoglContext *ctx;
{
g_error_free (catch_error);
g_object_unref (offscreen);
- cogl_object_unref (buffer);
return NULL;
}
g_object_unref (fb);
- shadow_pipeline = _st_create_shadow_pipeline (shadow_spec, buffer,
+ shadow_pipeline = _st_create_shadow_pipeline (shadow_spec,
+ g_steal_pointer (&buffer),
resource_scale);
-
- cogl_object_unref (buffer);
}
return shadow_pipeline;
CoglContext *ctx =
clutter_backend_get_cogl_context (clutter_get_default_backend ());
- return COGL_TEXTURE (cogl_texture_2d_new_with_size (ctx, min_width, min_height));
+ return cogl_texture_2d_new_with_size (ctx, min_width, min_height);
}
static char *
helper->height != height)
{
if (helper->pipeline)
- cogl_object_unref (helper->pipeline);
+ g_object_unref (helper->pipeline);
helper->pipeline = _st_create_shadow_pipeline_from_actor (helper->shadow, source);
helper->width = width;
copy = g_new (StShadowHelper, 1);
*copy = *helper;
if (copy->pipeline)
- cogl_object_ref (copy->pipeline);
+ g_object_ref (copy->pipeline);
st_shadow_ref (copy->shadow);
return copy;
st_shadow_helper_free (StShadowHelper *helper)
{
if (helper->pipeline)
- cogl_object_unref (helper->pipeline);
+ g_object_unref (helper->pipeline);
st_shadow_unref (helper->shadow);
g_free (helper);
}
if (texture && policy == ST_TEXTURE_CACHE_POLICY_FOREVER)
- cogl_object_ref (texture);
+ g_object_ref (texture);
return texture;
}
* clutter_image_set_data(), so it's safe to use the texture
* of ClutterImage here. */
texdata = clutter_image_get_texture (CLUTTER_IMAGE (image));
- cogl_object_ref (texdata);
+ g_object_ref (texdata);
ensure_monitor_for_file (cache, file);
cairo_surface_destroy (surface);
- texture = COGL_TEXTURE (cogl_texture_2d_new_from_data (ctx, size, size,
- COGL_PIXEL_FORMAT_CAIRO_ARGB32_COMPAT,
- rowstride,
- data,
- &error));
+ texture = cogl_texture_2d_new_from_data (ctx, size, size,
+ COGL_PIXEL_FORMAT_CAIRO_ARGB32_COMPAT,
+ rowstride,
+ data,
+ &error);
if (error)
{
if (texture)
{
material = _st_create_texture_pipeline (texture);
- cogl_object_unref (texture);
+ g_object_unref (texture);
}
g_free (key);
if (interior_path != NULL)
cairo_path_destroy (interior_path);
- texture = COGL_TEXTURE (cogl_texture_2d_new_from_data (ctx,
- texture_width,
- texture_height,
- COGL_PIXEL_FORMAT_CAIRO_ARGB32_COMPAT,
- rowstride,
- data,
- &error));
+ texture = cogl_texture_2d_new_from_data (ctx,
+ texture_width,
+ texture_height,
+ COGL_PIXEL_FORMAT_CAIRO_ARGB32_COMPAT,
+ rowstride,
+ data,
+ &error);
if (error)
{
void
st_theme_node_invalidate_border_image (StThemeNode *node)
{
- cogl_clear_object (&node->border_slices_texture);
- cogl_clear_object (&node->border_slices_pipeline);
+ g_clear_object (&node->border_slices_texture);
+ g_clear_object (&node->border_slices_pipeline);
}
static gboolean
void
st_theme_node_invalidate_background_image (StThemeNode *node)
{
- cogl_clear_object (&node->background_texture);
- cogl_clear_object (&node->background_pipeline);
- cogl_clear_object (&node->background_shadow_pipeline);
+ g_clear_object (&node->background_texture);
+ g_clear_object (&node->background_pipeline);
+ g_clear_object (&node->background_shadow_pipeline);
}
static gboolean
/* Free handles we can't reuse */
had_prerendered_texture = (state->prerendered_texture != NULL);
- cogl_clear_object (&state->prerendered_texture);
+ g_clear_object (&state->prerendered_texture);
if (state->prerendered_pipeline != NULL)
{
- cogl_clear_object (&state->prerendered_pipeline);
+ g_clear_object (&state->prerendered_pipeline);
if (node->border_slices_texture == NULL &&
state->box_shadow_pipeline != NULL)
{
- cogl_clear_object (&state->box_shadow_pipeline);
+ g_clear_object (&state->box_shadow_pipeline);
had_box_shadow = TRUE;
}
}
/* Render offscreen */
fb_width = ceilf (state->box_shadow_width * state->resource_scale);
fb_height = ceilf (state->box_shadow_height * state->resource_scale);
- buffer = COGL_TEXTURE (cogl_texture_2d_new_with_size (ctx, fb_width, fb_height));
+ buffer = cogl_texture_2d_new_with_size (ctx, fb_width, fb_height);
if (buffer == NULL)
return;
g_clear_error (&error);
g_clear_object (&offscreen);
- cogl_clear_object (&buffer);
+ g_clear_object (&buffer);
}
static void
{
int corner_id;
- cogl_clear_object (&state->prerendered_texture);
- cogl_clear_object (&state->prerendered_pipeline);
- cogl_clear_object (&state->box_shadow_pipeline);
+ g_clear_object (&state->prerendered_texture);
+ g_clear_object (&state->prerendered_pipeline);
+ g_clear_object (&state->box_shadow_pipeline);
for (corner_id = 0; corner_id < 4; corner_id++)
- cogl_clear_object (&state->corner_material[corner_id]);
+ g_clear_object (&state->corner_material[corner_id]);
if (unref_node)
st_theme_node_paint_state_set_node (state, NULL);
state->box_shadow_height = other->box_shadow_height;
if (other->box_shadow_pipeline)
- state->box_shadow_pipeline = cogl_object_ref (other->box_shadow_pipeline);
+ state->box_shadow_pipeline = g_object_ref (other->box_shadow_pipeline);
if (other->prerendered_texture)
- state->prerendered_texture = cogl_object_ref (other->prerendered_texture);
+ state->prerendered_texture = g_object_ref (other->prerendered_texture);
if (other->prerendered_pipeline)
- state->prerendered_pipeline = cogl_object_ref (other->prerendered_pipeline);
+ state->prerendered_pipeline = g_object_ref (other->prerendered_pipeline);
for (corner_id = 0; corner_id < 4; corner_id++)
if (other->corner_material[corner_id])
- state->corner_material[corner_id] = cogl_object_ref (other->corner_material[corner_id]);
+ state->corner_material[corner_id] = g_object_ref (other->corner_material[corner_id]);
}
void
g_return_val_if_fail (width > 0, FALSE);
g_return_val_if_fail (height > 0, FALSE);
- cogl_clear_object (&priv->old_texture);
- priv->old_texture = COGL_TEXTURE (cogl_texture_2d_new_with_size (ctx, width, height));
+ g_clear_object (&priv->old_texture);
+ priv->old_texture = cogl_texture_2d_new_with_size (ctx, width, height);
- cogl_clear_object (&priv->new_texture);
- priv->new_texture = COGL_TEXTURE (cogl_texture_2d_new_with_size (ctx, width, height));
+ g_clear_object (&priv->new_texture);
+ priv->new_texture = cogl_texture_2d_new_with_size (ctx, width, height);
if (priv->old_texture == NULL)
return FALSE;
g_clear_object (&priv->old_theme_node);
g_clear_object (&priv->new_theme_node);
- cogl_clear_object (&priv->old_texture);
- cogl_clear_object (&priv->new_texture);
+ g_clear_object (&priv->old_texture);
+ g_clear_object (&priv->new_texture);
g_clear_object (&priv->old_offscreen);
g_clear_object (&priv->new_offscreen);
- cogl_clear_object (&priv->material);
+ g_clear_object (&priv->material);
if (priv->timeline)
{
g_clear_object (&node->background_image);
- cogl_clear_object (&node->background_texture);
- cogl_clear_object (&node->background_pipeline);
- cogl_clear_object (&node->background_shadow_pipeline);
- cogl_clear_object (&node->border_slices_texture);
- cogl_clear_object (&node->border_slices_pipeline);
- cogl_clear_object (&node->color_pipeline);
+ g_clear_object (&node->background_texture);
+ g_clear_object (&node->background_pipeline);
+ g_clear_object (&node->background_shadow_pipeline);
+ g_clear_object (&node->border_slices_texture);
+ g_clear_object (&node->border_slices_pipeline);
+ g_clear_object (&node->color_pipeline);
G_OBJECT_CLASS (st_theme_node_parent_class)->finalize (object);
}